Skip to content

test(regression): serve the pre-1994 Q3 accession lookups from committed full-index files - #2043

Merged
dgunning merged 1 commit into
mainfrom
test/pin-pre-1994-index-lookup
Nov 23, 2026
Merged

dgunning merged 1 commit into
mainfrom
test/pin-pre-1994-index-lookup

Conversation

@dgunning

Copy link
Copy Markdown
Owner

What this changes

Test-only. The two end-to-end lookups in test_issue_g00j_pre_1994q3_quarters.py used to download SEC's quarterly form indexes on every run (about 16 s on a cold cache). EFTS only indexes 2001 onward, so these lookups always fall through to the quarterly index scan, which is the path the old hardcoded 1994 Q3 start in available_quarters() blocked. The test still runs that scan, but now reads the indexes from committed files instead of SEC.

  • tests/fixtures/full_index/<year>/QTR<n>/form.gz: the five indexes the scan reads (1993 Q1-Q3, 1994 Q1-Q2), 670 KB gzipped, laid out under SEC's own paths. The README gives each file's SHA-256 (decompressed content).
  • The lookup class is now fast. A fixture serves download_text from those files, treats EFTS as a miss, and fails on any other URL. Each test asserts which quarters were read: 1994 Q1 then Q2, and 1993 Q1 to Q3.
  • The file runs in 0.16 s, down from about 16 s.

No changelog fragment: nothing user-visible changes.

Verification

  • Ground truth: unchanged assertions against 0000003673-94-000052 (ALLEGHENY POWER SYSTEM INC, 35-CERT, 1994-06-30) and 0000873611-93-000002 (24F-2NT, 1993-09-28), now resolved from the committed SEC indexes
  • Regression test is in tests/issues/regression/
  • Mutation probe: restoring the 1994 Q3 start in available_quarters() fails both lookup tests; they pass on main
  • Passes under the offline harness (-p tests._offline_harness), so it makes no network requests
  • hatch run test-fast: 52,450 passed, 9 skipped; check-regression-provenance OK; ruff clean on the changed file

AI assistance

  • Assisted. Tool and model: Claude Code, Claude Opus 5.5

🤖 Generated with Claude Code

…ted full-index files

The two accession lookups in the pre-1994 Q3 quarters regression test
(0000003673-94-000052, a 1994 Q2 35-CERT, and 0000873611-93-000002, a
1993 Q3 24F-2NT) downloaded SEC's quarterly form indexes on every run,
about 16 s on a cold cache. EFTS only indexes 2001 onward, so these
lookups always fall through to the quarterly index scan, which is the
path the old hardcoded 1994 Q3 start blocked.

The five indexes the scan reads (1993 Q1-Q3, 1994 Q1-Q2, 670 KB
gzipped) are now committed under tests/fixtures/full_index/ with a
README giving each file's SHA-256. The tests serve the scan from them,
treat EFTS as a miss, and assert which quarters were read. The class
is now fast; the file runs in 0.16 s.

Mutation-probed: restoring the 1994 Q3 start fails both lookups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgunning
dgunning merged commit 26a657d into main Nov 23, 2026
13 checks passed
@dgunning
dgunning deleted the test/pin-pre-1994-index-lookup branch November 23, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant